using System;
using System.Data;
using System.Collections.Generic;
using Soccer.Core;
using Soccer.Utility;

namespace Soccer.Business
{
    [TableAttribute("Lineups")]
	[Serializable]
    public class Lineup : DBO<Lineup>
    {
		#region Fields
		
		private int? _IdLineup;
		private int? _IdMatch;
		private string _Lineup;
		private string _ClubLineup;
		
		#endregion
		
		#region Constructors
		/// <summary>
		/// Default constructor
		/// </summary>
		public Lineup()
		{
			
		}
		
		/// <summary>
		/// Constructor with IdLineup 
		/// </summary>
		/// <param name="IdLineup">The IdLineup</param>
		public Lineup(int? IdLineup )
		{
			this.IdLineup = IdLineup;
		}
		
		/// <summary>
		/// Constructor with all parameters
		/// </summary>
		/// <param name="IdLineup">Sets int? value for IdLineup</param>
		/// <param name="IdMatch">Sets int? value for IdMatch</param>
		/// <param name="Lineup">Sets string value for Lineup</param>
		/// <param name="ClubLineup">Sets string value for ClubLineup</param>
		public Lineup(int? idLineup, int? idMatch, string lineup, string clubLineup)
		{
			this.IdLineup = idLineup;
			this.IdMatch = idMatch;
			this.Lineup1 = lineup;
			this.ClubLineup = clubLineup;
		}
		
		#endregion
		
		#region Properties
		
		/// <summary>
		/// Gets or sets int? value for IdLineup
		/// </summary>
		[ColumnAttribute("IdLineup", SqlDbType.Int , 4 , true, true, false)]
		public int? IdLineup
		{
			set
			{
				this._IdLineup = value;
			}
			get
			{
				return this._IdLineup;
			}
		}
		
		/// <summary>
		/// Gets or sets int? value for IdMatch
		/// </summary>
		[ColumnAttribute("IdMatch", SqlDbType.Int , 4 , false, false, true)]
		public int? IdMatch
		{
			set
			{
				this._IdMatch = value;
			}
			get
			{
				return this._IdMatch;
			}
		}
		
		/// <summary>
		/// Gets or sets string value for Lineup
		/// </summary>
		[ColumnAttribute("Lineup", SqlDbType.NVarChar , 50 , false, false, true)]
		public string Lineup1
		{
			set
			{
				this._Lineup = value;
			}
			get
			{
				return this._Lineup;
			}
		}
		
		/// <summary>
		/// Gets or sets string value for ClubLineup
		/// </summary>
		[ColumnAttribute("ClubLineup", SqlDbType.NVarChar , 50 , false, false, true)]
		public string ClubLineup
		{
			set
			{
				this._ClubLineup = value;
			}
			get
			{
				return this._ClubLineup;
			}
		}
		
		
		/// <summary>
		/// Get a list LineupDetail of current Lineup object base on IdLineup
		/// </summary>
		public List<LineupDetail> LineupDetailListForIdLineup
		{
			get
			{
				if (this.IdLineup == null)
					return null;
				LineupDetail condition = new LineupDetail();
				condition.IdLineup = this.IdLineup;
				return LineupDetailController.FindItems(condition);
			}
		}
		
		/// <summary>
		/// Get a Match of current Lineup object base on IdMatch
		/// </summary>
		public Match Match
		{
			get
			{
				if (this.IdMatch == null)
					return null;
	
				Match condition = new Match(this.IdMatch);
				return MatchController.FindItem(condition);
			}
		}
		
		#endregion
        
        #region Other Properties
        private static ColumnNameStruct? _ColumnName;
        public static ColumnNameStruct ColumnName
        {
            get
            {
                if (!_ColumnName.HasValue)
                    _ColumnName = new ColumnNameStruct();
                return _ColumnName.Value;
            }
        }
        #endregion

        #region NestedType
        public  struct ColumnNameStruct
        {
            /// <summary>
            /// Get the name of column [IdLineup]
            /// </summary>
            public string IdLineup
            {
                get
                {
                    return "IdLineup";
                }
            }
            /// <summary>
            /// Get the name of column [IdMatch]
            /// </summary>
            public string IdMatch
            {
                get
                {
                    return "IdMatch";
                }
            }
            /// <summary>
            /// Get the name of column [Lineup]
            /// </summary>
            public string Lineup
            {
                get
                {
                    return "Lineup";
                }
            }
            /// <summary>
            /// Get the name of column [ClubLineup]
            /// </summary>
            public string ClubLineup
            {
                get
                {
                    return "ClubLineup";
                }
            }
        }
        #endregion
    }
}
